f[x_, 
        y_] := -2 x^2 - y^2 + x*y + 8  x + 3  y

(* checkneme,  
        ci naozaj nieco rata :) *) 
f[4, 10]

f[2, 
      2]

gu = 
      Plot3D[f[x, y], {x, 0, 4}, {y, 0, 10}, BoxRatios -> {1, 1, 1},  
        PlotRange -> {0, 20}]

(* logickou uvahou je jasne,  
      ze moze nakupit maximalne 10 minut v rozhlase,  
      a maximalne 3 minuty v TV,  
      takze funkcia moznych rieseni je takato: *) 
go  =  
      ParametricPlot3D[{x, 10 - 3  x, z}, {x, 0, 4}, {z, 0, 
          20}]

Show[gu, go, AxesLabel -> {"x", "y", "z"}, 
      ViewPoint -> {-2.100,  -2.374,  1.184}]

y = 10 - 3*x

Simplify[f[x, y]]

Fun[x_] := Simplify[f[x, y]]

Solve[
      D[Fun[x], x] == 0, x]

N[%]

(D[Fun[x], {x, 2}]) /. x -> 69/28

y /. 
      x -> 69/28

N[%]

Fun[x] /. 
      x -> 69/28

N[%]